<template>
	<div class="modify-dialog">
		<slot> </slot>
		<el-dialog :close-on-click-modal="false" v-bind="dialogOpts" :visible.sync="dialogVisible">
			<Form v-bind="formOpts" v-on="formEvent">
				<template #formBtn>
					<div class="dialog-footer">
						<el-button @click="dialogVisible = false">取 消</el-button>
						<el-button type="primary" @click="onConfirm"> 确 定 </el-button>
					</div>
				</template>
			</Form>
		</el-dialog>
	</div>
</template>

<script>
import modifyMixins from "@/mixins/modifyMixins.vue";
export default {
	mixins: [modifyMixins],
	data () {
		return {
			form: {
				count: {
					tag: "el-input-number",
					label: "库存数量",
					value: "",
					props: {
						min: 0,
						clearable: true,
						placeholder: "请输入库存数量",
					},
				},
			},
		};
	},
	methods: {
		onSubmit (form) {
			const { modify, row } = this;
			const { id } = row;
			if (modify === "modifyCount")
				this.$api.patchInventory({ ...form, id }).then(this.submitDone);
      // if (modify === "modifyWarePosition")
			// 	this.$api.patchInventory({ ...form, id }).then(this.submitDone);
		},
	},
};
</script>

<style lang="less" scoped></style>

